﻿using MiniFox.Components;
using MiniFox.Platform.OAuth2.Configurations;

namespace MiniFox.Platform.OAuth2.Providers
{
    /// <summary>
    /// 
    /// </summary>
    [AutoRegister, SpareComponent(typeof(DefaultOAuth2ConfigProvider))]
    public interface IOAuth2ConfigProvider
    {
        /// <summary>
        /// 
        /// </summary>
        AccessTokenConfiguration AccessTokenConfiguration
        {
            get;
        }
        /// <summary>
        /// 
        /// </summary>
        PassportConfiguration PassportConfiguration
        {
            get;
        }
        /// <summary>
        /// 
        /// </summary>
        AuthorizationConfiguration AuthorizationConfiguration
        {
            get;
        }
    }

    internal class DefaultOAuth2ConfigProvider : IOAuth2ConfigProvider
    {
        [AutoConfigure]
        public AccessTokenConfiguration AccessTokenConfiguration
        {
            get;set;
        }

        [AutoConfigure]
        public PassportConfiguration PassportConfiguration
        {
            get; set;
        }

        [AutoConfigure]
        public AuthorizationConfiguration AuthorizationConfiguration
        {
            get; set;
        }
    }
}
